/*
 * @Author: 孙大大
 * @Date: 2022-04-13 15:16:00
 * @LastEditTime: 2022-04-13 15:16:01
 * @FilePath: \黑马面面 - 副本\src\api\subject.js
 */
import request from "@/utils/request";
// 学科列表
export function getSubjectsList(params) {
  return request({
    url: "/subjects",
    params,
  });
}
// 学科删除
export function delUserData(id) {
  return request({
    url: `/subjects/${id}`,
    method: "delete",
  });
}
// 学科添加
export function addSubjectList(data) {
  return request({
    url: "/subjects",
    method: "post",
    data,
  });
}
// 学科修改
export function editSubjectData(data) {
  return request({
    url: `/subjects/${data.id}`,
    method: "put",
    data,
  });
}
// 学科详情
export function detailUserData(id) {
  return request({
    url: `/subjects/${id}`,
    method: "get",
  });
}
// 目录列表
export function getDirectorysList(params) {
  return request({
    url: "/directorys",
    params,
  });
}
// 目录详情
export function detailDirectorysData(id) {
  return request({
    url: `/directorys/${id}`,
    method: "get",
  });
}
// 目录添加
export function addDirectorysList(data) {
  return request({
    url: "/directorys",
    method: "post",
    data,
  });
}

// 目录修改
export function editDirectorysData(data) {
  return request({
    url: `/directorys/${data.id}`,
    method: "put",
    data,
  });
}

// 删除目录
export function delDirectorysData(id) {
  return request({
    url: `/directorys/${id}`,
    method: "delete",
  });
}

// 目录状态
export function changeStateDirectorys(id, state) {
  return request({
    url: `/directorys/${id}/${state}`,
    method: "post",
  });
}

// 标签列表
export function getTagsList(params) {
  return request({
    url: "/tags",
    params,
  });
}
// 标签添加
export function addTagsList(data) {
  return request({
    url: "/tags",
    method: "post",
    data,
  });
}
// 标签删除
export function delTagsData(id) {
  return request({
    url: `/tags/${id}`,
    method: "delete",
  });
}
// 标签修改
export function editTagsData(data) {
  return request({
    url: `/tags/${data.id}`,
    method: "put",
    data,
  });
}
// 标签详情
export function detailTagsData(id) {
  return request({
    url: `/tags/${id}`,
    method: "get",
  });
}

// 标签状态
export function changeStateTags(id, state) {
  return request({
    url: `/tags/${id}/${state}`,
    method: "post",
  });
}
